package com.cz.video.website.service;

import com.cz.video.common.core.domain.PageQuery;
import com.cz.video.common.core.page.TableDataInfo;
import com.cz.video.website.domain.bo.WebsiteCommentBo;
import com.cz.video.website.domain.vo.WebsiteCommentVo;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 评论表 服务类
 * </p>
 *
 * @author LLF
 * @since 2023-10-16
 */
public interface IWebsiteCommentService {

    /**
     * 新增评论表
     *
     * @param websiteComment 用户信息
     * @return 结果
     */


    @Transactional(rollbackFor = Exception.class)//Spring框架提供的注解
    int insertComment(WebsiteCommentBo websiteComment);

    int updateComment(WebsiteCommentBo websiteComment);

    /**
     * 分页查询查找评论表信息
     *
     * @param websiteComment
     * @param pageQuery
     * @return
     */
    TableDataInfo<WebsiteCommentVo> selectPageCommentList(WebsiteCommentBo websiteComment, PageQuery pageQuery);




    int deleteById(Long id);

    TableDataInfo<WebsiteCommentVo> selectCommentsWithUserDetails(WebsiteCommentBo websiteComment, PageQuery pageQuery);

    /**
     * 查询父评论
     * @param commentBo
     * @param pageQuery
     * @return
     */
    TableDataInfo<?> listParent(WebsiteCommentBo commentBo, PageQuery pageQuery);

    /**
     * 查询 回复的评论
     * @param parentIds
     * @return
     */
    List<WebsiteCommentVo> getReplyList(List<Long> parentIds);

    /**
     * 构建评论树
     * @param commentList
     * @return
     */
    List buildCommentTreeSelect(List<WebsiteCommentVo> commentList);
}
